<template>
    <el-container>
        <el-aside width="180px">
            <el-menu >
                <el-menu-item @click="onSeletType(item.id)" :index="item.id" :key="item.id" v-for="item in typeData">
                    <el-badge :show-zero="false" :value="item.value" class="item"><el-text>{{item.title}}</el-text></el-badge>
                </el-menu-item>
            </el-menu>
        </el-aside>
        <el-main class="pt0">
            <component v-if="form.model == 'Imprest'" :is="imprest" />
            <component v-if="form.model == 'Reimburse'" :is="reimburse" />
            <component v-if="form.model == 'ProjectInvoice'" :is="projectInvoice" />
            <component v-if="form.model == 'MaterialPay'" :is="materialPay" />
            <component v-if="form.model == 'LaborPay'" :is="laborPay" />
        </el-main>
    </el-container>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import imprest from './pay/imprest.vue';
import reimburse from './pay/reimburse.vue';
import projectInvoice from './pay/projectInvoice.vue';
import materialPay from './pay/materialPay.vue';
import laborPay from './pay/laborPay.vue';
const form = ref<any>({search:'',model:'ProjectInvoice',page:0,current:0,total:10,limit:20,loading:false,parentBorder:false})
const typeData = ref<any>([
    {title:'甲方开票',id:'ProjectInvoice',value:0},
    {title:'材料付款',id:'MaterialPay',value:0},
    {title:'施工班组付款',id:'LaborPay',value:0},
    {title:'报销',id:'Reimburse',value:0},
    {title:'备用金',id:'Imprest',value:0},
])

const onSeletType = (data:string) => {
    form.value.model = data
}


</script>

<style scoped>

</style>